package com.ruoyi.project.secs;

import com.glorysoft.secsgem.core.SECSErrors;
import com.glorysoft.secsgem.secsmsg.MessageDispatcher;
import com.glorysoft.secsgem.secsmsg.SECSEventType;
import com.glorysoft.secsgem.secsmsg.SECSPort;
import com.glorysoft.secsgem.secsmsg.SECSTransaction;

import java.util.List;

public class MyMessageDispatcher implements MessageDispatcher {
    @Override
    public void SECSEventHandler(SECSPort secsPort, SECSEventType secsEventType, SECSTransaction secsTransaction, SECSErrors secsErrors, String s) {
        System.out.println(secsErrors.getValue()+":"+s);
        if("".equals(s)){
            TestController.send();
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("close");
//            TestController.port.ClosePort();
        }

    }
}
